﻿<!--#Include File="../Inc/Const.Asp" -->
<%
Call ChkLogin("login")
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
<!--
* { font-size:13px; }
body { background-color: #F3FAEB; margin: 0px; padding: 0px; }
.inputsub { font-size: 10px; margin: 0px; line-height: 80%; padding-top: 3px; }
-->
</style>
<script>
function addUploadItem(type,path,path2){

if (type=='gif'||type=='jpg'||type=='jpeg'||type=='jpe'||type=='bmp'||type=='png') {
parent.document.frm.indexpiclist.options[parent.document.frm.indexpiclist.length]=new Option(path2,path);
parent.document.frm.indexpiclist.selectedIndex+=1;
parent.document.getElementById('indexpicimg').innerHTML='<img src=' + path + ' height=95 width=150 />';
parent.document.getElementById("oIndexpic").value=path;
}
var oEditor = parent.FCKeditorAPI.GetInstance('oContent')

type=type.toLowerCase()
switch(type){
case 'gif':
oEditor.InsertHtml('<img src="' + path + '" />')
break;
case 'jpg':
oEditor.InsertHtml('<img src="' + path + '" />')
break;
case 'png':
oEditor.InsertHtml('<img src="' + path + '" />')
break;
case 'bmp':
oEditor.InsertHtml('<img src="' + path + '" />')
break;
case 'jpeg':
oEditor.InsertHtml('<img src="' + path + '" />')
break;
case 'mp3':
oEditor.InsertHtml('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"  id="MediaPlayer" width="450" height="70"><param name=""howStatusBar" value="-1"><param name="AutoStart" value="False"><param name="Filename" value="'+path+'"></object>')
break;
case 'wma':
oEditor.InsertHtml('<object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"  id="MediaPlayer" width="450" height="70"><param name=""howStatusBar" value="-1"><param name="AutoStart" value="False"><param name="Filename" value="'+path+'"></object>')
break;
case 'rm':
oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="300"><param name="SRC" value="'+path+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+path+'" nojava="true" controls="ImageWindow" console="one" width="400" height="300"></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="StatusBar" console="one" width="400" height="24" /></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="ControlPanel" console="one" width="400" height="24" autostart="true" loop="false" /></object>')
break;
case 'rmvb':
oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="300"><param name="SRC" value="'+path+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+path+'" nojava="true" controls="ImageWindow" console="one" width="400" height="300"></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="StatusBar" console="one" width="400" height="24" /></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="400" height="32" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+path+'" nojava="true" controls="ControlPanel" console="one" width="400" height="24" autostart="true" loop="false" /></object>')
break;
case 'ra':
oEditor.InsertHtml('<object classid="clsid:CFCDAA03-8BE4-11CF-B84B-0020AFBBCCFA" id="RAOCX" width="450" height="60"><param name="_ExtentX" value="6694"><param name="_ExtentY" value="1588"><param name="AUTOSTART" value="true"><param name="SHUFFLE" value="0"><param name="PREFETCH" value="0"><param name="NOLABELS" value="0"><param name="SRC" value="'+path+'"><param name="CONTROLS" value="StatusBar,ControlPanel"><param name="LOOP" value="0"><param name="NUMLOOP" value="0"><param name="CENTER" value="0"><param name="MAINTAINASPECT" value="0"><param name="BACKGROUNDCOLOR" value="#000000"><embed src="'+path+'" width="450" autostart="true" height="60"></embed></object>')
break;
case 'asf':
oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
break;
case 'avi':
oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
break;
case 'wmv':
oEditor.InsertHtml('<object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="400" height="300"><param name="FileName" VALUE="'+path+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+path+'" autostart="true" width="400" height="300" /></object>')
break;
case 'swf':
oEditor.InsertHtml('<embed src="'+path+'" width="400" height="300" scale="exactfit" play="true" loop="true" menu="true" wmode="Window" quality="1" type="application/x-shockwave-flash"></embed>')
break;
default :
oEditor.InsertHtml('<a href="'+path+'">'+path+'</a>')
break;
}
}
</script>
</head>
<body>
<%
IF Request.QueryString("Act")="Upload" Then
	Dim sSavePath : sSavePath = Installdir & "uploadfile/" & Year(Now) & Right("0"&Month(Now),2) & "/" & Day(Now) & "/" : Call CreateFolder(sSavePath & "index.html")
	Dim UpFile
	set UpFile = New UpLoadClass
	UpFile.AutoSave = 2
	UpFile.MaxSize =  Int(getLogin("admin", "uploadfilesize") * 1024) '# (1024*1024=1M) SESSION里的单位为KB
	UpFile.FileType = getLogin("admin", "uploadfileexts")
	UpFile.SavePath = sSavePath
	UpFile.Open() '# 打开对象
	If UpFile.Save("File",0) Then
		Call Insertuploadfile(sSavePath & UpFile.Form("File"))
		Response.write "<script>addUploadItem('" & LCase(UpFile.Form("File_Ext")) &"','" & sSavePath & UpFile.Form("File") & "','" & Replace(sSavePath & UpFile.Form("File"),"/uploadfile/","/") & "')</script>"
		Response.Write "<div style=""padding:6px""><a href='Upload.Asp'>文件上传成功，请返回继续上传</a></div>"
	Else
		Select Case UpFile.Form("File_Err")
		Case -1 : Response.Write "<div style=""padding:6px""><a href='Upload.Asp'>没有文件上传，请返回重新上传</a></div>"
		Case 1 : Response.Write "<div style=""padding:6px""><a href='Upload.Asp'>文件大小超出限制，请返回重新上传</a></div>"
		Case 2 : Response.Write "<div style=""padding:6px""><a href='Upload.Asp'>不允许上传的文件类型，请返回重新上传</a></div>"
		Case 3 : Response.Write "<div style=""padding:6px""><a href='Upload.Asp'>文件大小超出限制并且是不允许上传的文件类型，请返回重新上传</a></div>"
		Case Else : Response.Write "<div style=""padding:6px""><a href='Upload.Asp'>未知错误，请返回重新上传</a></div>"
		End Select
	End If
	Set UpFile = Nothing	
Else
	Response.Write("<form name=""frm"" enctype=""multipart/form-data"" method=""post"" action=""Upload.Asp?Act=Upload""><input name=""File"" type=""File"" size=""39"" style=""font-size:12px;border-width:1px"">&nbsp;<input type=""Submit"" name=""Submit"" value="" 上 传 "" class=""inputsub""></form>")
End IF
%>
